package com.game.globalconst;

import java.util.HashMap;


/**
 * 
 * @author ZGame 返回结果封装
 *
 */
public class Result extends HashMap<String, Object> {

	private static final long serialVersionUID = 1L;

	public boolean isOk() {
		return get("Result") == null ? false : (boolean) get("Result");
	}
	
	public static Result build(){
		Result r = new Result(true);
		return r;
	};

	public String ok() {
		return JsonUtil.parseToString(this);
	}

	public Result(boolean result) {
		put("Result", result);
	}

	public String error(String key,String language) {
		put("Result",false);
		return JsonUtil.parseToString(this);
	}
}
